# Maintainer: Bruno Pagani <archange@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Gustavo Alvarez <sl1pkn07@gmail.com>

pkgname=pugixml
pkgver=1.13
pkgrel=1
pkgdesc="Light-weight, simple and fast XML parser for C++ with XPath support"
arch=(loong64 x86_64)
url="https://pugixml.org"
license=(MIT)
depends=(gcc-libs)
makedepends=(cmake)
source=(https://github.com/zeux/pugixml/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('40c0b3914ec131485640fa57e55bf1136446026b41db91c1bef678186a12abbe')

build() {
    cmake -B build -S ${pkgname}-${pkgver%.1} \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DBUILD_SHARED_LIBS=ON
    make -C build
}

package() {
    make -C build DESTDIR="${pkgdir}" install
    install -Dm644 ${pkgname}-${pkgver%.1}/readme.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
